class Blog < ApplicationRecord

  validates :title, presence: { message: "标题不能为空"}
  validates :content, uniqueness: { message: "内容已存在"}
  validates :user_id, uniqueness: { message: "用户已存在"}

  belongs_to :user
end
